package uestc.lj.gulishop.auth.service;

import org.springframework.validation.BindingResult;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import uestc.lj.gulishop.auth.vo.UserLoginVO;
import uestc.lj.gulishop.auth.vo.UserRegistVO;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @Author:Crazlee
 * @Date:2021/6/10
 */
public interface LoginService {
    boolean sendCode(String phone);

    boolean regist(UserRegistVO userRegistVO, BindingResult result, RedirectAttributes redirectAttributes);

    boolean login(UserLoginVO userLoginVO, RedirectAttributes redirectAttributes, HttpSession session);

    /**
     * 根据code换取accesstoken
     *
     * @param code
     * @param session
     * @param httpResponse
     * @return
     */
    boolean weiboLogin(String code, HttpSession session, HttpServletResponse httpResponse) throws Exception;
}
